package com.hjm.project.finance.agentDeductions.service.impl;

import com.hjm.common.utils.text.Convert;
import com.hjm.project.finance.agentDeductions.domain.AgentDeductions;
import com.hjm.project.finance.agentDeductions.mapper.AgentDeductionsMapper;
import com.hjm.project.finance.agentDeductions.service.IAgentDeductionsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 代理商扣款规则Service业务层处理
 * 
 * @author maker-platform
 * @date 2022-10-21
 */
@Service
public class AgentDeductionsServiceImpl implements IAgentDeductionsService {
    @Resource
    private AgentDeductionsMapper agentDeductionsMapper;

    /**
     * 查询代理商扣款规则
     * 
     * @param id 代理商扣款规则ID
     * @return 代理商扣款规则
     */
    @Override
    public AgentDeductions selectAgentDeductionsById(Integer id) {
        return agentDeductionsMapper.selectAgentDeductionsById(id);
    }

    /**
     * 查询代理商扣款规则列表
     * 
     * @param agentDeductions 代理商扣款规则
     * @return 代理商扣款规则
     */
    @Override
    public List<AgentDeductions> selectAgentDeductionsList(AgentDeductions agentDeductions) {
        return agentDeductionsMapper.selectAgentDeductionsList(agentDeductions);
    }

    /**
     * 查询代理商扣款规则列表
     *
     * @param agentDeductions 代理商扣款规则
     * @return 代理商扣款规则 一个结果
     */
    @Override
    public AgentDeductions selectAgentDeductionsOne(AgentDeductions agentDeductions) {
        return agentDeductionsMapper.selectAgentDeductionsOne(agentDeductions);
    }

    /**
     * 新增代理商扣款规则
     * 
     * @param agentDeductions 代理商扣款规则
     * @return 结果
     */
    @Override
    public int insertAgentDeductions(AgentDeductions agentDeductions) {
        return agentDeductionsMapper.insertAgentDeductions(agentDeductions);
    }

    /**
     * 修改代理商扣款规则
     * 
     * @param agentDeductions 代理商扣款规则
     * @return 结果
     */
    @Override
    public int updateAgentDeductions(AgentDeductions agentDeductions) {
        return agentDeductionsMapper.updateAgentDeductions(agentDeductions);
    }

    /**
     * 删除代理商扣款规则对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAgentDeductionsByIds(String ids) {
        return agentDeductionsMapper.deleteAgentDeductionsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除代理商扣款规则信息
     * 
     * @param id 代理商扣款规则ID
     * @return 结果
     */
    @Override
    public int deleteAgentDeductionsById(Integer id) {
        return agentDeductionsMapper.deleteAgentDeductionsById(id);
    }

    /**
     * 删除代理商扣款规则对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int upaddAgentDeductionsByIds(String ids) {
        return agentDeductionsMapper.upaddAgentDeductionsByIds(ids);
    }

    /**
     * 审核代理商扣款规则
     *
     * @param agentDeductions
     * @return 结果
     */
    public int auditAgentDeductions(AgentDeductions agentDeductions){
        return agentDeductionsMapper.auditAgentDeductions(agentDeductions);
    }
}
